// 智慧内容数据管理
export interface WisdomItem {
  id: string
  title: string
  content: string
  category: string
  subcategory: string
  tags: string[]
  priority: "high" | "medium" | "low"
  time: string
  source?: string
  author?: string
  difficulty: "初级" | "中级" | "高级" | "大师级"
}

export const wisdomDatabase: WisdomItem[] = [
  // 商业战略类
  {
    id: "strategy_001",
    title: "平台经济的网络效应原理",
    content: "双边市场通过连接供需两端，形成正向反馈循环，用户越多价值越大",
    category: "商业战略",
    subcategory: "商业模式",
    tags: ["平台经济", "网络效应", "商业模式"],
    priority: "high",
    time: "2小时前",
    difficulty: "高级",
  },
  {
    id: "strategy_002",
    title: "客户生命周期价值最大化策略",
    content: "通过提升客户留存率和客单价，实现长期价值最大化",
    category: "商业战略",
    subcategory: "客户管理",
    tags: ["客户价值", "留存率", "盈利模式"],
    priority: "high",
    time: "3小时前",
    difficulty: "中级",
  },

  // 领导智慧类
  {
    id: "leadership_001",
    title: "情商在团队管理中的应用",
    content: "通过情绪管理和同理心建立高效团队，提升组织凝聚力",
    category: "领导智慧",
    subcategory: "情商修炼",
    tags: ["情商", "团队管理", "领导力"],
    priority: "high",
    time: "1小时前",
    difficulty: "中级",
  },

  // 谋略兵法类
  {
    id: "tactics_001",
    title: "孙子兵法：知己知彼的商业应用",
    content: "深入了解自身优势和竞争对手，制定精准的竞争策略",
    category: "谋略兵法",
    subcategory: "古典智慧",
    tags: ["孙子兵法", "竞争策略", "商业智慧"],
    priority: "medium",
    time: "4小时前",
    source: "孙子兵法",
    difficulty: "高级",
  },
]

// 获取分类内容
export function getWisdomByCategory(category: string): WisdomItem[] {
  return wisdomDatabase.filter((item) => item.category === category)
}

// 搜索智慧内容
export function searchWisdom(query: string): WisdomItem[] {
  return wisdomDatabase.filter(
    (item) =>
      item.title.includes(query) || item.content.includes(query) || item.tags.some((tag) => tag.includes(query)),
  )
}

// 获取推荐内容
export function getRecommendedWisdom(limit = 5): WisdomItem[] {
  return wisdomDatabase.filter((item) => item.priority === "high").slice(0, limit)
}
